<!-- quirks -->
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"/>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta name="renderer" content="webkit"/>
	<title>扩展对象</title>
	<link href="../ting-quirks.css" rel="stylesheet"/>
	<!--[if lt IE 9]><script src="../dist/sky-compat.js"></script><![endif]-->
	<!--[if gte IE 9]><!--><script src="../dist/sky-modern.js"></script><!--><![endif]-->
	<script src="../demo.js"></script>
</head>
<body>
<div class="container-fluid">
	<h3>Date</h3>
	<h4>Date.prototype.toLocaleFormat</h4>
	<p>按特定的格式将一个日期转换成一个字符串。</p>
	<table class="table table-bordered table-condensed table-striped">
		<thead>
			<tr class="primary">
				<th>格式</th><th>描述</th><th>例子</th>
			</tr>
		</thead>
		<tbody class="table-hover">
			<tr>
				<td>%x</td><td>本地日期格式</td><td>2014/06/03</td>
			</tr>
			<tr>
				<td>%X</td><td>本地时间格式</td><td>06:03:04</td>
			</tr>
			<tr>
				<td>%T</td><td>时间格式</td><td>06:03:04</td>
			</tr>
			<tr>
				<td>%Y</td><td>年完整版</td><td>2008</td>
			</tr>
			<tr>
				<td>%y</td><td>年缩写</td><td>09</td>
			</tr>
			<tr>
				<td>%m</td><td>月</td><td>1~12</td>
			</tr>
			<tr>
				<td>%e</td><td>日(一个月中的第几天)(不会补0)</td><td>1~31</td>
			</tr>
			<tr>
				<td>%d</td><td>日(一个月中的第几天)</td><td>01~31</td>
			</tr>
			<tr>
				<td>%H</td><td>几时(按24小时)</td><td>00~23</td>
			</tr>
			<tr>
				<td>%i</td><td>几时(按12小时)</td><td>00~11</td>
			</tr>
			<tr>
				<td>%M</td><td>分</td><td>00~59</td>
			</tr>
			<tr>
				<td>%S</td><td>秒</td><td>00~59</td>
			</tr>
			<tr>
				<td>%p</td><td>AM或PM"</td><td>AM或PM</td>
			</tr>
			<tr>
				<td>%%</td><td>原义的%</td><td>%</td>
			</tr>
		</tbody>
	</table>
	<div class="btn-toolbar">
		<a class="btn btn-primary" href="javascript:alert(new Date().toLocaleFormat('%Y-%m-%d %H:%M:%S'))">%Y-%m-%d %H:%M:%S</a>
		<a class="btn btn-primary" href="javascript:alert(new Date().toLocaleFormat('%x %X %T %Y %y %e %d %H %i %M %S %p %%x%'))">%x %X %T %Y %y %e %d %H %i %M %S %p %%x%</a>
	</div>
	<h4>Date.prototype.toISOString</h4>
	<p>返回一个 ISO（ISO 8601 Extended Format）格式的字符串。</p>
	<div class="btn-toolbar">
		<a class="btn btn-primary" href="javascript:alert(new Date().toISOString())">toISOString</a>
	</div>
	<h4>Date.prototype.toJSON</h4>
	<p>使用JSON.stringify时，对Date的处理。</p>
	<div class="btn-toolbar">
		<a class="btn btn-primary" href="javascript:alert(new Date().toJSON())">toJSON</a>
		<a class="btn btn-primary" href="javascript:alert(JSON.stringify(new Date()))">JSON.stringify</a>
	</div>
	<h4>Date.prototype.toLocaleString</h4>
	<p>返回该日期对象的字符串。</p>
	<div class="btn-toolbar">
		<a class="btn btn-primary" href="javascript:alert(new Date().toLocaleString())">toLocaleString</a>
		<a class="btn btn-primary" href="javascript:alert(new Date().toLocaleDateString())">toLocaleDateString</a>
		<a class="btn btn-primary" href="javascript:alert(new Date().toLocaleTimeString())">toLocaleTimeString</a>
	</div>
	<h4>Date.now</h4>
	<p>获取当前时间戳。</p>
	<div class="btn-toolbar">
		<a class="btn btn-primary" href="javascript:alert(Date.now())">Date.now()</a>
	</div>
</div>
</body>
</html>